package com.kob.matchingsystem.service.impl;

import com.kob.matchingsystem.service.MatchingService;
import com.kob.matchingsystem.service.impl.utils.MatchingPool;
import org.springframework.stereotype.Service;

/**
 * 匹配服务实现类
 *
 * @Author: CZY
 * @date: 2024/9/2 23:00
 */
@Service
public class MatchingServiceImpl implements MatchingService {
    public final static MatchingPool matchingPool = new MatchingPool();

    // 添加一名玩家
    @Override
    public String addPlayer(Integer userId, Integer rating, Integer botId) {
//        System.out.println("add player: " + userId + " " + rating);
        matchingPool.addPlayer(userId, rating, botId);
        return "add player success";
    }

    // 删除一名玩家
    @Override
    public String removePlayer(Integer userId) {
//        System.out.println("remove player: " + userId);
        matchingPool.removePlayer(userId);
        return "remove player success";
    }
}
